<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <%@include file="/common/header.jsp"%>
</head>
<body>

<div class="container " style="margin-top: 20px">
    <%@include file="/common/top.jsp"%>
    <div class="row">
        <div class="col-sm-3">
            <%@include file="/common/menu.jsp"%>
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">产品编辑</h1>
                </div>
            </div>
            <div class="row col-sm-10">
                <form class="form-horizontal" action="/product?cmd=saveOrUpdate" method="post" id="editForm">
                
                    <input type="hidden"  name="id" value="${p.id}">
                    
                    <div class="form-group" >
                        <label for="name" class="col-sm-2 control-label">产品名称：</label>
                        <div class="col-sm-6">
                        <input type="text" class="form-control" id="productName" name="productName"  value="${p.productName}">
                        </div>
                    </div>
                    <div class="form-group" >
                        <label for="name" class="col-sm-2 control-label">产品分类：</label>
                        <div class="col-sm-6">
                        <select name="dirId" class="form-control">
                            <option value="1" ${p.dirId==1 ? 'selected' : ''}>1</option>
                            <option value="2" ${p.dirId==2 ? 'selected' : ''}>2</option>
                            <option value="3" ${p.dirId==3 ? 'selected' : ''}>3</option>
                            <option value="4" ${p.dirId==4 ? 'selected' : ''}>4</option>
                            <option value="5" ${p.dirId==5 ? 'selected' : ''}>5</option>
                            <option value="6" ${p.dirId==6 ? 'selected' : ''}>6</option>
                            <option value="7" ${p.dirId==7 ? 'selected' : ''}>7</option>
                            <option value="8" ${p.dirId==8 ? 'selected' : ''}>8</option>
                            <option value="9" ${p.dirId==9 ? 'selected' : ''}>9</option>
                        </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="sn" class="col-sm-2 control-label">售价：</label>
                        <div class="col-sm-6">
                        <input type="number" class="form-control" id="salePrice" name="salePrice"  value="${p.salePrice}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="sn" class="col-sm-2 control-label">供应商：</label>
                        <div class="col-sm-6">
                        <input type="text" class="form-control" id="supplier" name="supplier"  value="${p.supplier}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="sn" class="col-sm-2 control-label">品牌：</label>
                        <div class="col-sm-6">
                        <input type="text" class="form-control" id="brand" name="brand"  value="${p.brand}">
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="sn" class="col-sm-2 control-label">折扣：</label>
                        <div class="col-sm-6">
                        <input type="number" class="form-control" id="cutoff" name="cutoff" max="1" min="0" value="${p.cutoff}" step="0.1">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="sn" class="col-sm-2 control-label">成本价：</label>
                        <div class="col-sm-6">
                        <input type="number" class="form-control" id="costPrice" name="costPrice"  value="${p.costPrice}">
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-6">
                            <button id="btn_submit" type="submit" class="btn btn-default">保存</button>
                            <button type="reset" class="btn btn-default">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>